home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.1 (Developer) [x86] / NeXT Step 3.1 Intel dev.cdr.dmg / NextDeveloper / Examples / AppKit / Draw / graphicsUndo.subproj / LockGraphicsChange.m < prev    next >
Text File  |  1992-02-09  |  994b  |  50 lines

  1. #import "drawundo.h"
  2.  
  3. @interface LockGraphicsChange(PrivateMethods)
  4.  
  5. - redoDetails;
  6.  
  7. @end
  8.  
  9. @implementation LockGraphicsChange
  10.  
  11. - (const char *)changeName
  12. {
  13.     return NXLocalStringFromTable("Operations", "Lock", NULL, "The operation of locking down all selected graphics so that they can't be edited in anyway until they are unlocked.");
  14. }
  15.  
  16. - undoChange
  17. {
  18.     [graphics makeObjectsPerform:@selector(unlock)];
  19.     [graphics makeObjectsPerform:@selector(select)];
  20.     [graphicView resetLockedFlag];
  21.     [graphicView getSelection];
  22.  
  23.     return [super undoChange];
  24. }
  25.  
  26. - changeDetailClass
  27. {
  28.     return nil;
  29. }
  30.  
  31. - redoDetails
  32. {
  33.     int i, count;
  34.     List *selectedGraphics;
  35.     id graphic;
  36.     
  37.     selectedGraphics = [graphicView selectedGraphics];
  38.     count = [graphics count];
  39.     for (i = 0; i < count; i++) {
  40.         graphic = [graphics objectAt:i];
  41.     [graphic lock];
  42.     [graphic deselect];
  43.     [selectedGraphics removeObject:graphic];
  44.     }
  45.     [graphicView resetLockedFlag];
  46.  
  47.     return self;
  48. }
  49.  
  50. @end